package PAPModified;

import org.semanticweb.owlapi.model.OWLClass;
import org.semanticweb.owlapi.model.OWLOntology;

import com.aliasi.spell.JaroWinklerDistance;

public class ClassAnchor {
	private JaroWinklerDistance winkler = new JaroWinklerDistance();
	private OWLOntology ontologyBi, ontologyBj;
	private OWLClass classBi, classBj;
	
	public ClassAnchor(OWLClass classBi, OWLClass classBj,
			OWLOntology ontologyBi, OWLOntology ontologyBj) {
		super();
		this.ontologyBi = ontologyBi;
		this.ontologyBj = ontologyBj;
		this.classBi = classBi;
		this.classBj = classBj;
	}

	public OWLClass getClassBi() {
		return classBi;
	}

	public void setClassBi(OWLClass classBi) {
		this.classBi = classBi;
	}

	public OWLClass getClassBj() {
		return classBj;
	}

	public void setClassBj(OWLClass classBj) {
		this.classBj = classBj;
	}
	
	@Override
	public String toString() {
		if (getClassBi() != null && getClassBj() != null) {
			return getClassBi().getIRI().getFragment() + " - " + getClassBj().getIRI().getFragment();
		} else {
			return "Null value.";
		}
	}
	
	public double getProximity() {
		return winkler.proximity(ReaderRDF.getLabel(classBi, ontologyBi), ReaderRDF.getLabel(classBj, ontologyBj));
	}


}
